import request from "@/utils/request";
import type { LoginApiResponse } from "./model/loginmodel";
enum Api {
  login = "/admin/acl/index/login",
  logout = "/admin/acl/index/logout",
  getUserInfo = "/admin/acl/index/info",
}

// 登陆
export const loginApi = (username: string, password: string) => {
  return request.post<any, LoginApiResponse>(Api.login, { username, password });
};

// 登出
export const logoutApi = () => {
  return request.post<any, null>(Api.login);
};

// 获取用户信息
export const getUserInfoApi = () => {
  return request.post<any, null>(Api.getUserInfo);
};
